import {
  axios
} from '@/utils/request'

// 款型管理列表
function getModelStyleList (data) {
  return axios({
    url: '/vehicle-service/model-style/page',
    method: 'get',
    params: data
  })
}

// 导入款型
function importModelStyleList (params) {
  return axios({
    url: '/vehicle-service/import/model-style',
    method: 'post',
    data: params,
    timeout: 120000
  })
}

// 下载款型模板
function importModelStyleTemplate () {
  return axios({
    url: '/vehicle-service/import/template/modelStyle',
    method: 'get',
    responseType: 'blob'
  })
}

// 款型列表导出
function exportModelStyleList (params) {
  return axios({
    url: '/vehicle-service/model-style/export',
    method: 'get',
    params: params,
    responseType: 'blob'
  })
}

// 获取款项详情
function getModelStyleDetail (params) {
  return axios({
    url: '/vehicle-service/model-style/info/'+params,
    method: 'get',
  })
}

// 新增
function addModelStyle (data) {
  return axios({
    url: '/vehicle-service/model-style',
    method: 'post',
    data
  })
}

// 编辑
function editModelStyle (data) {
  return axios({
    url: '/vehicle-service/model-style',
    method: 'put',
    data
  })
}

// 删除
function deleteModelStyle (data) {
  return axios({
    url: '/vehicle-service/model-style',
    method: 'delete',
    data
  })
}

export default {
  exportModelStyleList,
  getModelStyleList,
  addModelStyle,
  editModelStyle,
  getModelStyleDetail,
  deleteModelStyle,
  importModelStyleList,
  importModelStyleTemplate
}